package cn.xttc.edu.service.impl;

import cn.xttc.edu.entity.Order;
import cn.xttc.edu.entity.vo.OrderVo;
import cn.xttc.edu.mapper.OrderMapper;
import cn.xttc.edu.service.OrderService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 杨磊
 * @since 2022-03-09
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public IPage<OrderVo> getOrderVosByCondition(Page<OrderVo> page, Integer status, String search) {
        return orderMapper.getOrderVosByCondition(page, status, search);
    }

    @Override
    public List<OrderVo> getOrdersByCIdAndStatus(Integer cId, Integer[] statuses) {
        return orderMapper.getOrdersByCIdAndStatus(cId, statuses);
    }

    @Override
    public List<OrderVo> getAllWaitingOrders() {
        return orderMapper.getAllWaitingOrders();
    }

    @Override
    public List<OrderVo> getOrdersByDIdAndStatus(Integer id, Integer status) {
        return orderMapper.getOrdersByDIdAndStatus(id, status);
    }

}
